// src/shared/api/system.ts

import { ApiResponse } from '../types';
import {
  getBanners as getBannersService,
  BannerListResponse
} from '../service/systemService';

/**
 * Mock API: 获取轮播图列表
 * GET /api/system/banners
 */
export const GET_banners = async (): Promise<ApiResponse<BannerListResponse>> => {
  try {
    // 模拟网络延迟
    await new Promise(resolve => setTimeout(resolve, 200));

    // 调用Service层
    const result = await getBannersService();

    return result;
  } catch (error) {
    console.error('Get Banners API Error:', error);
    return {
      code: 500,
      message: '网络请求失败',
      data: null
    };
  }
};